import bingbao from './weather-icons/bingbao.png'
import lei from './weather-icons/lei.png'
import qing from './weather-icons/qing.png'
import shachen from './weather-icons/shachen.png'
import wu from './weather-icons/wu.png'
import xue from './weather-icons/xue.png'
import yin from './weather-icons/yin.png'
import yu from './weather-icons/yu.png'
import yun from './weather-icons/yun.png'

// xue、lei、shachen、wu、bingbao、yun、yu、yin、qing
export enum WEATHER_IMG {
  XUE = 'xue',
  LEI = 'lei',
  SHACHEN = 'shachen',
  WU = 'wu',
  BINGBAO = 'bingbao',
  YUN = 'yun',
  YU = 'yu',
  YIN = 'yin',
  QING = 'qing',
}

export function getWeatherImg(weather: string) {
  switch (weather) {
    case WEATHER_IMG.XUE:
      return xue
    case WEATHER_IMG.LEI:
      return lei
    case WEATHER_IMG.SHACHEN:
      return shachen
    case WEATHER_IMG.WU:
      return wu
    case WEATHER_IMG.BINGBAO:
      return bingbao
    case WEATHER_IMG.YUN:
      return yun
    case WEATHER_IMG.YU:
      return yu
    case WEATHER_IMG.YIN:
      return yin
    case WEATHER_IMG.QING:
      return qing
    default:
      return qing
  }
}

export interface WeatherInfo {
  city: string
  wea: string
  wea_img: string
  tem: string
  tem_day: string
  tem_night: string
  [key: string]: any
}
